var ajax=function(f,cmd){
  if (window.XMLHttpRequest) var x=new XMLHttpRequest();
  else var x=new ActiveXObject("Microsoft.XMLHTTP");
  x.onreadystatechange=function(){ if(x.readyState==4 && x.status==200){	//alert(x.responseText);
    f(x.responseText); //execute
  }}
  x.open("GET",cmd,true); x.send();
}